﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
using System.Web.UI.MobileControls;
using System.Collections.Generic;
using Common.Modules;
using Entity;


namespace Web
{
    public partial class Test : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            //SqlConnection con = new SqlConnection(@"Data Source=192.168.100.200;Initial Catalog=QuesSys;Persist Security Info=True;User ID=sa;Password=Win2008");
            //SqlCommand cmd = new SqlCommand("select SubjectId from User_Subject where UserId=199", con);
            //IList<string> list = new List<string>();
            //try
            //{

            //    con.Open();
            //    SqlDataReader dataReader = cmd.ExecuteReader();
            //    while (dataReader.Read())
            //    {
            //        list.Add(dataReader["SubjectId"].ToString());
            //    }

            //}
            //catch (Exception ex)
            //{

            //    throw;
            //}
            //finally
            //{
            //    con.Close();
            //}
            //Response.Write("<script>alert(" + list.Count + ");</script>");
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            PdfMaker pm = new PdfMaker();
            var examroomInfos = new List<ExamRoomInfo>();
            examroomInfos.Add(new ExamRoomInfo() { ExamName = "math", ExamAreaName = "hd", Comment = "every one is good" });
            examroomInfos.Add(new ExamRoomInfo() { ExamName = "laungae", ExamAreaName = "cp", Comment = "very bad" });
            pm.Initialize();
            pm.AddStudentCover("李金凤", "海淀培训");
            pm.AddHeader("考试评估报告");
            pm.AddChapter("综合分析");
            pm.AddPdfTable<ExamRoomInfo>(examroomInfos, "考试信息表", new float[] { 6f, 6f, 6f },
                m => m.ExamName, m => m.ExamAreaName, m => m.Comment);
            pm.AddSimpleParagraph("旅途充满了乌龙事件——Cappi丢行李，我也丢行李；还有错过末班车、转车乘错方向、找错航站楼……在欢乐又痛苦的小插曲中，圆满地完成了此次旅行。当然，回来之后也没省心，6000多张照片，导出的时候还曾发生copy问题，导致1000多张照片损坏，花了一个下午+一个晚上终于在一家数码修复的公司重新找回了这些珍贵的图片。磨磨蹭蹭地整理到今天，终于开帖了。");
            pm.SavePdf();
        }
    }
}
